package com.ihisun.tmhcms.security.securitdao;

import com.ihisun.tmhcms.security.entity.SysRoleEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SysRoleDao extends JpaRepository<SysRoleEntity,Long> {
    @Query(value = "select sr.role_name,sr.role_id,sr.create_time,sr.update_time from sys_user_role sur INNER JOIN sys_role sr on sur.user_id=:id and sr.role_id=sr.role_id",nativeQuery = true)
    public List<SysRoleEntity> findByRoleId(@Param("id") Long id);
}
